﻿using System.Collections.ObjectModel;
using System.ComponentModel;
using GBlason.ViewModel;
using GBlason.ViewModel.CoatOfArm;
using GBlason.ViewModel.General;

namespace GBlason.Control.Aggregate
{
    /// <summary>
    /// Interaction logic for ResourcePage.xaml
    /// </summary>
    public partial class ResourcePage : INotifyPropertyChanged
    {
        /// <summary>
        /// Gets or sets the data resources.
        /// </summary>
        /// <value>
        /// The data resources.
        /// </value>
        public ObservableCollection<EditableResourceViewModel> DataResources { get; set; } 
        
        public ResourcePage()
        {
            InitializeComponent();
            DataResources = new ObservableCollection<EditableResourceViewModel>(GbrFileViewModel.GetResources.AvailableTinctures);
            foreach (var shapeResource in GbrFileViewModel.GetResources.ScaledForMenuShapeResources)
            {
                DataResources.Add(shapeResource);
            }
            OnPropertyChanged("DataResources");
        }

        #region INotifyPropertyChanged Members

        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

    }
}
